# Maintainer : Christian Rebischke <Chris.Rebischke@archlinux.org>
# Contributor: Jan Hicken <firstname [dot] lastname [at] posteo [dot] de>

pkgname=networkmanager-strongswan
_pkgname=NetworkManager-strongswan
pkgver=1.6.0
pkgrel=1
pkgdesc="Strongswan NetworkManager plugin"
arch=('loong64' 'x86_64')
url="https://wiki.strongswan.org/projects/strongswan/wiki/NetworkManager"
license=('GPL')
depends=('libnm' 'libsecret' 'strongswan>=5.5.1')
makedepends=('libnma' 'intltool')
optdepends=('libnma: GUI support')
source=("https://download.strongswan.org/NetworkManager/$_pkgname-$pkgver.tar.bz2"{,.sig})
sha512sums=('ecfae6c100f9344d07a9d67f01894edbd509178698ad3bce6f8c1ccdd53e08baca4e95c10f7f72991b163042f9cc19d876bcf71ab8b2efb10a25c5e00fe03572'
            'SKIP')
validpgpkeys=('12538F8F689B5F1F15F07BE1765FE26C6B467584') # Tobias Brunner

build() {
  cd "$_pkgname-$pkgver"
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --libexecdir=/usr/lib --disable-static --disable-more-warnings \
    --without-libnm-glib --with-charon=/usr/lib/strongswan/charon-nm
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd "$_pkgname-$pkgver"
  make check
}

package() {
  cd "$_pkgname-$pkgver"
  make DESTDIR="$pkgdir" install
}

# vim:set ts=2 sw=2 et:
